/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.demo;

import java.util.function.Consumer;
import java.util.stream.Stream;

/**
 * <p>Project: app2022 - Stream10
 * <p>Powered by webrx On 2022-01-26 17:38:09
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Stream10 {
    public static void main(String[] args) {
        Consumer o = System.out::println;
        Stream.of(1, 2, 3).forEach(o);
        var is = Stream.of(
                new Book(1, "《java1》", true),
                new Book(2, "《php》", false),
                new Book(3, "《java1》", true),
                new Book(4, "《java1》", true)
        );
        is.filter(book -> book.isJava()).forEach(System.out::println);
        is.filter(Book::isJava).forEach(System.out::println);
    }
}
